package com.tingyuge.mongo.service;

import cn.hutool.json.JSONUtil;
import com.tingyuge.mongo.entity.Resume;
import com.tingyuge.mongo.repository.ResumeRepository;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author xiaodao
 * @version 1.0
 * @description
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class ResumeService {

    private final ResumeRepository resumeRepository;

    @Transactional
    public void save(Resume resume) {
        Resume save = resumeRepository.save(resume);
        System.out.println(JSONUtil.toJsonStr(save));
        System.out.println(1/0);
    }
}
